package colm.lagou.city;

import com.lagou.common.entity.IdWorker;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableCaching    //开始配置缓存
public class CityApplication {
    public static void main(String[] args) {
        SpringApplication.run(CityApplication.class);
    }

    //直接把一些第三方（jar包）拿过来用
    //1.那里用到就 new IdWorker()
    //spring ---> 容器    实例放到spring容器中
    //@Controller  @Service
    @Bean
    public IdWorker idWorker(){
        return new IdWorker();
    }
}
